# Contributor: Bart Ribbers <bribbers@disroot.org>
maintainer="Bart Ribbers <bribbers@disroot.org>"
pkgname=qxmpp
pkgver=1.8.3
pkgrel=0
pkgdesc="Cross-platform C++ XMPP client and server library"
arch="all"
url="https://github.com/qxmpp-project/qxmpp"
license="LGPL-2.1"
makedepends="
	cmake
	doxygen
	graphviz
	libomemo-c-dev
	qca-dev
	qt5-qtbase-dev
	samurai
	"
source="https://github.com/qxmpp-project/qxmpp/archive/v$pkgver/qxmpp-v$pkgver.tar.gz"
subpackages="$pkgname-dev $pkgname-doc"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_EXAMPLES=OFF \
		-DBUILD_DOCUMENTATION=ON \
		-DBUILD_OMEMO=ON
	cmake --build build
}

check() {
	# tst_qxmppiceconnection and tst_qxmpptransfermanager require a network connection
	ctest --test-dir build -E "(tst_qxmppiceconnection|tst_qxmpptransfermanager)"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
b447a2c48edb00db9c61af4b641f219274905258809595b6fe40b58c9d7f4f7bd02f3256219bed3a9815b99d4ffa53995feab98c674aafd733d92094aa6437fa  qxmpp-v1.8.3.tar.gz
"
